import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class test {
    public static void main(String[] args) {
        test t1 = new test();
        System.out.println();
    }

    public int[] twoSum(int[] nums, int target) {
        int i = 0;
        int j = 0;
        for (; i <= nums.length - 2; i++) {
            for (; j <= nums.length - 2; j++) {
                if (nums[i] + nums[j + 1] == target) {
                    break;
                }
            }
        }
        return new int[]{i, j + 1};
    }

    public boolean isPAlindrome(int x) {
        if (x < 0) {
            return false;
        } else {
            String i = Integer.toString(x);

            StringBuffer j = new StringBuffer(i);
            StringBuffer y = j.reverse();
            long x1 = Long.parseLong(y.toString());
            long x2 = x;
            if (x2 == x1) {
                return true;
            } else {
                return false;
            }
        }
    }

    public void moveZeroes(int[] nums) {
        List<Integer> list=new ArrayList<>();
        int count=0;
        for(int i=0;i<nums.length;i++){
            if(nums[i]==0){
                count++;
                continue;
            }
            list.add(nums[i]);
        }
        for(int i =0;i<count;i++){
            list.add(0);
        }
        int[] temp =list.stream().mapToInt(Integer::intValue).toArray();
        for (int i=0;i<nums.length;i++){
            nums[i] = temp[i];
        }

    }

    //只出现一次的数字
    public int singleNumber(int[] nums) {
        int sum = 0;
        for(int num:nums){
            sum ^= num;
        }
        return sum;
    }


    //多数元素
    public int majorityElement(int[] nums) {
        Arrays.sort(nums);
        int a = (nums.length+1)/2;
        return nums[a];
    }

    //爬楼梯
    public int climbStairs(int n) {

        return 0;
    }

    //方法1
    void f1(){}
    //方法2
    void f2(){}
    //方法3
    void f3(){
        System.out.println(333);
    }

}

